package com.easygo;

import com.spring4all.swagger.EnableSwagger2Doc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

import javax.servlet.MultipartConfigElement;

/**
 * @author 徐策
 * @date 2020/1/7 15:36
 */
@SpringBootApplication
@EnableSwagger2Doc
@EnableFeignClients // 开启Feign功能
@EnableEurekaClient // 开启Eureka客户端
public class AdminWebApp {
    public static void main(String[] args) {
        SpringApplication.run(AdminWebApp.class);

    }
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        //单个文件最大
        factory.setMaxFileSize("20480KB");
        /// 设置总上传数据总大小
        factory.setMaxRequestSize("204800KB");

        return factory.createMultipartConfig();
    }
}
